package main

import "fmt"

func strStr(haystack string, needle string) int {
	if len(needle) == 0 {
		return 0
	}
    for i, _ :=range haystack{
        if haystack[i] == needle[0]{
        	real :=true
            for j,_ := range needle{
                if i+j >= len(haystack) || haystack[i+j]!= needle[j] {
                    real=false
                    break
                }
            }
            if real == true {
                return i
            }
        }
    }
    return -1
}
func main(){
	haystack := "mississippi"
	needle:= "issip"
	fmt.Println(strStr(haystack,needle))
}